class MyJstProcessor < Sprockets::JstProcessor
  def prepare
    @namespace = "this.#{Rails.application.config.exoskeleton_base}.templates"
  end
  def evaluate(scope, locals, &block)
    existing_path = scope.logical_path.inspect
    new_path = existing_path.gsub 'backbone/templates/', ''

    <<-JST
      (function() {
        #{namespace} || (#{namespace} = {});
        #{namespace}[#{new_path}] = #{indent(data)};
      }).call(this);
    JST
  end
end

